#include "qcorewidgetplugin.h"


#include "qmywidget.h"
#include "qmypushbutton.h"
#include "qmycombobox.h"
#include "qmylineedit.h"
#include "qmyspinbox.h"
#include "qmytimeedit.h"
#include "qmyslider.h"
#include "qmylabel.h"
#include "qmyprogressbar.h"

#include "../../lib/shared/qobjecthost.h"

#include <qplugin.h>

QCoreWidgetPlugin::QCoreWidgetPlugin()
{
    qRegPropertyType("QImageProperty","unchecked normal");
    qRegPropertyType("QImageProperty","unchecked disabled");
    qRegPropertyType("QImageProperty","unchecked hover");
    qRegPropertyType("QImageProperty","unchecked pressed");
    qRegPropertyType("QImageProperty","checked normal");
    qRegPropertyType("QImageProperty","checked disabled");
    qRegPropertyType("QImageProperty","checked hover");
    qRegPropertyType("QImageProperty","checked pressed");
    qRegPropertyType("QBorderProperty","border");
}

QWidget *QCoreWidgetPlugin::createWidget(const QString &widgetName, QWidget *parentWidget)
{
    if(widgetName=="QWidget")
    {
        return new QMyWidget(parentWidget);
    }
    else if(widgetName=="QPushButton")
    {
        return new QMyPushButton(parentWidget);
    }
    else if(widgetName=="QRadioButton")
    {
        return new QMyRadioButton(parentWidget);
    }
    else if(widgetName=="QCheckBox")
    {
        return new QMyCheckBox(parentWidget);
    }
    else if (widgetName=="QComboBox")
    {
        return new QMyComboBox(parentWidget);
    }
    else if(widgetName=="QLineEdit")
    {
        return new QMyLineEdit(parentWidget);
    }
    else if(widgetName=="QSpinBox")
    {
        return new QMySpinBox(parentWidget);
    }
    else if(widgetName=="QDoubleSpinBox")
    {
        return new QMyDoubleSpinBox(parentWidget);
    }
    else if(widgetName=="QTimeEdit")
    {
        return new QMyTimeEdit(parentWidget);
    }
    else if(widgetName=="QDateEdit")
    {
        return new QMyDateEdit(parentWidget);
    }
    else if(widgetName=="QDateTimeEdit")
    {
        return new QMyDateTimeEdit(parentWidget);
    }
    else if(widgetName=="QSlider")
    {
        return new QMySlider(parentWidget);
    }
    else if(widgetName=="QDial")
    {
        return new QMyDial(parentWidget);
    }
    else if(widgetName=="QLabel")
    {
        return new QMyLabel(parentWidget);
    }
    else if(widgetName=="QLCDNumber")
    {
        return new QMyLCDNumber(parentWidget);
    }
    else if(widgetName=="QProgressBar")
    {
        return new QMyProgressBar(parentWidget);
    }
    return NULL;
}

QStringList QCoreWidgetPlugin::keys()
{
    return QStringList();
}


Q_EXPORT_PLUGIN2(QCoreWidgetPlugin, QCoreWidgetPlugin)
